feat(apps): export ENGINE_VERSION from definition layer#40183
feat(apps): export ENGINE_VERSION from definition layer#40183d-gubert wants to merge 2 commits intofeat/apps-engine-splitfrom
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughRefactors Apps Engine version discovery to use a compile-time exported constant. Adds Changes
Sequence Diagram(s)(omitted — changes do not introduce multi-component control-flow requiring a sequence diagram) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/apps-engine-split #40183 +/- ##
==========================================================
- Coverage 69.87% 69.82% -0.06%
==========================================================
Files 3297 3297
Lines 119267 119267
Branches 21550 21556 +6
==========================================================
- Hits 83339 83275 -64
- Misses 32627 32676 +49
- Partials 3301 3316 +15
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
bdb5d73 to
2ab8b32
Compare
6ea43b5 to
04703c2
Compare
04703c2 to
7664485
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
packages/apps-engine/src/definition/version.ts (2)
1-11: Trim the leading doc block per coding guidelines.The repo guideline for
**/*.{ts,tsx,js}is to avoid code comments in the implementation. The rationale here is genuinely non-obvious (compile-time vs runtime path resolution), so consider keeping at most a one-line note next to therequire()call and dropping the rest, or moving the explanation to the PR/commit description.As per coding guidelines: "Avoid code comments in the implementation".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/apps-engine/src/definition/version.ts` around lines 1 - 11, Remove the long leading doc block and replace it with a single-line comment immediately adjacent to the require() that reads package.json (e.g. "// Use require() so TS doesn't resolve the path at compile time"), keeping the actual code (the require() call and exported version constant) unchanged; move the detailed explanation into the PR/commit message instead of the source.
16-16: Consider freezing the dependency on a moving package shape.
require(requirePath).versionwill silently produceundefined(typed asstring) if the field is ever missing or the file is renamed. Since the whole point of this module is to fail loudly when version detection breaks, a small assertion would be cheap and would surface misconfiguration immediately at module load:🛡️ Suggested guard
-// eslint-disable-next-line import/no-dynamic-require, `@typescript-eslint/no-require-imports` -- Paths are bounded, we just need to decide which package.json file to target -export const ENGINE_VERSION: string = require(requirePath).version; +// eslint-disable-next-line import/no-dynamic-require, `@typescript-eslint/no-require-imports` -- Paths are bounded, we just need to decide which package.json file to target +const { version } = require(requirePath) as { version?: string }; +if (typeof version !== 'string') { + throw new Error(`Apps-Engine: failed to resolve version from ${requirePath}`); +} +export const ENGINE_VERSION: string = version;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/apps-engine/src/definition/version.ts` at line 16, The current export ENGINE_VERSION uses require(requirePath).version which can silently be undefined; update the module so after loading the package JSON via require(requirePath) (using the existing requirePath symbol) you assert that the loaded object has a non-empty version property and throw a clear error if not present, then assign that value to ENGINE_VERSION; ensure the runtime check happens at module load so any missing/renamed field fails loudly with a helpful message mentioning requirePath and "version".packages/apps-engine/src/server/compiler/AppPackageParser.ts (1)
10-10: Optional: drop the redundant instance field.
appsEngineVersionis now just a copy of the module-levelENGINE_VERSIONconstant — the per-instance field, the explicitstringannotation, and the indirection at the call sites no longer add value. Using the constant directly makes the dependency more obvious and removes one layer of state on the parser.♻️ Proposed simplification
- private appsEngineVersion: string = ENGINE_VERSION; - @@ - if (!semver.satisfies(this.appsEngineVersion, info.requiredApiVersion)) { - throw new RequiredApiVersionError(info, this.appsEngineVersion); + if (!semver.satisfies(ENGINE_VERSION, info.requiredApiVersion)) { + throw new RequiredApiVersionError(info, ENGINE_VERSION); }Skip if you want to preserve the field as a stable seam for future test injection.
Also applies to: 18-18
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/apps-engine/src/server/compiler/AppPackageParser.ts` at line 10, The instance field appsEngineVersion on AppPackageParser is redundant because it just mirrors the module-level ENGINE_VERSION; remove the appsEngineVersion declaration and any constructor assignment, then change all call sites inside AppPackageParser that reference this.appsEngineVersion to use ENGINE_VERSION directly (retain import of ENGINE_VERSION). Ensure you also remove the explicit string type annotation and any related tests or references that assume the per-instance field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/apps-engine/src/definition/version.ts`:
- Around line 12-13: The OS-dependent dirname check using
__dirname.endsWith('src/definition') can fail on Windows; update the
runningFromSource logic to use path utilities instead (import path) — e.g.,
determine runningFromSource by checking path.basename(path.dirname(__dirname))
=== 'src' && path.basename(__dirname) === 'definition' or by normalizing
separators with path.join/normalize, then set requirePath accordingly; modify
the runningFromSource and requirePath calculation (symbols: runningFromSource,
__dirname, requirePath) to use path methods so the correct package.json path is
chosen cross-platform.
---
Nitpick comments:
In `@packages/apps-engine/src/definition/version.ts`:
- Around line 1-11: Remove the long leading doc block and replace it with a
single-line comment immediately adjacent to the require() that reads
package.json (e.g. "// Use require() so TS doesn't resolve the path at compile
time"), keeping the actual code (the require() call and exported version
constant) unchanged; move the detailed explanation into the PR/commit message
instead of the source.
- Line 16: The current export ENGINE_VERSION uses require(requirePath).version
which can silently be undefined; update the module so after loading the package
JSON via require(requirePath) (using the existing requirePath symbol) you assert
that the loaded object has a non-empty version property and throw a clear error
if not present, then assign that value to ENGINE_VERSION; ensure the runtime
check happens at module load so any missing/renamed field fails loudly with a
helpful message mentioning requirePath and "version".
In `@packages/apps-engine/src/server/compiler/AppPackageParser.ts`:
- Line 10: The instance field appsEngineVersion on AppPackageParser is redundant
because it just mirrors the module-level ENGINE_VERSION; remove the
appsEngineVersion declaration and any constructor assignment, then change all
call sites inside AppPackageParser that reference this.appsEngineVersion to use
ENGINE_VERSION directly (retain import of ENGINE_VERSION). Ensure you also
remove the explicit string type annotation and any related tests or references
that assume the per-instance field.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5d087932-7c0a-49de-8a34-c7617688fe4f
📒 Files selected for processing (3)
packages/apps-engine/src/definition/version.tspackages/apps-engine/src/server/compiler/AppPackageParser.tspackages/apps-engine/tsconfig.json
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
packages/apps-engine/src/definition/version.tspackages/apps-engine/src/server/compiler/AppPackageParser.ts
🧠 Learnings (4)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38068
File: packages/apps-engine/deno-runtime/handlers/lib/assertions.ts:8-12
Timestamp: 2026-01-08T15:07:57.458Z
Learning: In packages/apps-engine/deno-runtime, App objects are never serialized and are instantiated and kept in the runtime context, so duck-typing checks on App methods (including protected methods like extendConfiguration) are reliable for runtime assertions.
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39701
File: packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts:181-188
Timestamp: 2026-03-18T16:45:52.113Z
Learning: In `packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts`, granting `--allow-read` to the full `this.tempFilePath` (entire temp directory) in the Deno subprocess spawn options is intentional. The `deno.jsonc` config file can affect path resolution in ways that require read access to the broader temp directory, not just the `deno-runtime` subdirectory symlink. Do not flag this as an overly broad permission grant.
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.
Applied to files:
packages/apps-engine/src/definition/version.tspackages/apps-engine/src/server/compiler/AppPackageParser.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.
Applied to files:
packages/apps-engine/src/definition/version.tspackages/apps-engine/src/server/compiler/AppPackageParser.ts
📚 Learning: 2026-01-08T15:07:57.458Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 38068
File: packages/apps-engine/deno-runtime/handlers/lib/assertions.ts:8-12
Timestamp: 2026-01-08T15:07:57.458Z
Learning: In packages/apps-engine/deno-runtime, App objects are never serialized and are instantiated and kept in the runtime context, so duck-typing checks on App methods (including protected methods like extendConfiguration) are reliable for runtime assertions.
Applied to files:
packages/apps-engine/src/server/compiler/AppPackageParser.ts
🔇 Additional comments (1)
packages/apps-engine/tsconfig.json (1)
13-13: LGTM.Enabling
resolveJsonModuleis consistent with the new JSON consumption insrc/definition/version.ts. Note the actual version load there still uses dynamicrequire()(intentionally, to avoid TS resolving the path at compile time and emitting an incorrect relative path from the compiled location), so this option is mainly defensive for any future static JSON imports.
| const runningFromSource = __dirname.endsWith('src/definition'); | ||
| const requirePath = runningFromSource ? '../../package.json' : '../package.json'; |
There was a problem hiding this comment.
Path heuristic is OS-dependent — breaks on Windows.
__dirname on Windows uses backslashes (e.g. C:\…\src\definition), so endsWith('src/definition') will always be false there and the wrong relative path will be selected when running tests via ts-node on Windows. Even if Windows is not a primary target, it's a one-line fix:
🔧 Suggested fix
-const runningFromSource = __dirname.endsWith('src/definition');
-const requirePath = runningFromSource ? '../../package.json' : '../package.json';
+const runningFromSource = __dirname.split(/[\\/]/).slice(-2).join('/') === 'src/definition';
+const requirePath = runningFromSource ? '../../package.json' : '../package.json';Or use path.basename(path.dirname(__dirname)) === 'src' && path.basename(__dirname) === 'definition'.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const runningFromSource = __dirname.endsWith('src/definition'); | |
| const requirePath = runningFromSource ? '../../package.json' : '../package.json'; | |
| const runningFromSource = __dirname.split(/[\\/]/).slice(-2).join('/') === 'src/definition'; | |
| const requirePath = runningFromSource ? '../../package.json' : '../package.json'; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/apps-engine/src/definition/version.ts` around lines 12 - 13, The
OS-dependent dirname check using __dirname.endsWith('src/definition') can fail
on Windows; update the runningFromSource logic to use path utilities instead
(import path) — e.g., determine runningFromSource by checking
path.basename(path.dirname(__dirname)) === 'src' && path.basename(__dirname) ===
'definition' or by normalizing separators with path.join/normalize, then set
requirePath accordingly; modify the runningFromSource and requirePath
calculation (symbols: runningFromSource, __dirname, requirePath) to use path
methods so the correct package.json path is chosen cross-platform.
Adds `src/definition/version.ts` which reads the package version via
`resolveJsonModule` and exports it as `ENGINE_VERSION`.
Replaces `AppPackageParser.getEngineVersion()` — which resolved the
version by traversing the filesystem relative to `__dirname` — with a
direct import of `ENGINE_VERSION`. This removes the assumption that
`package.json` lives at a predictable relative path, which will break
when `AppPackageParser` moves to a different package during the
apps-engine split.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(apps-engine): fix ENGINE_VERSION runtime path in compiled output
Static `import { version } from '../../package.json'` resolves correctly
during TypeScript compilation (source lives at src/definition/) but the
emitted require('../../package.json') exits the package root at runtime
once compiled to definition/version.js (outDir='.', rootDir='./src').
Switching to require('../package.json') — which is the correct path
relative to the compiled output — and bypassing TypeScript's compile-time
module resolution avoids the path mismatch entirely.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
7664485 to
c8ceba3
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/apps-engine/src/definition/version.ts (1)
12-13:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMake runtime path detection cross-platform.
Line 12 uses a POSIX-suffix check; Windows
__dirnameuses\, sorunningFromSourcecan be false and Line 13 can resolve the wrongpackage.json.Suggested fix
+import path from 'node:path'; + -const runningFromSource = __dirname.endsWith('src/definition'); +const runningFromSource = + path.basename(path.dirname(__dirname)) === 'src' && + path.basename(__dirname) === 'definition'; const requirePath = runningFromSource ? '../../package.json' : '../package.json';#!/bin/bash python - <<'PY' paths = [ r"C:\repo\packages\apps-engine\src\definition", "/repo/packages/apps-engine/src/definition", ] for p in paths: print(f"{p} -> endsWith('src/definition') = {p.endswith('src/definition')}") PY🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/apps-engine/src/definition/version.ts` around lines 12 - 13, The runtime path detection uses a POSIX string suffix on __dirname (const runningFromSource) which fails on Windows; change the check to a cross-platform comparison using Node's path utilities (path.normalize/path.join or splitting by path.sep) to compare the last path segments (e.g., 'src' and 'definition') and then set requirePath accordingly; update the symbols runningFromSource, requirePath and reference __dirname when implementing the normalized/joined comparison so the correct package.json is resolved on all platforms.
🧹 Nitpick comments (1)
packages/apps-engine/src/definition/version.ts (1)
1-11: ⚡ Quick winRemove the implementation block comment in this module.
Please drop or relocate this explanatory block to PR/docs to keep implementation code comment-free per repo guidance.
Suggested cleanup
-/** - * The version of the Apps-Engine package. - * Consumed by host-side code (e.g. AppPackageParser) to validate app compatibility - * without relying on filesystem path traversal. - * - * Uses require() instead of a static import so TypeScript does not resolve the path - * at compile time. - * - * When running for tests, using ts-node, package.json is located two levels above the current file. - * When running in production, package.json is located one level above the compiled version of this file. - */ const runningFromSource = __dirname.endsWith('src/definition');As per coding guidelines: "Avoid code comments in the implementation."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/apps-engine/src/definition/version.ts` around lines 1 - 11, Remove the large explanatory block comment at the top of the module (the multi-line comment describing Apps-Engine package version, require() rationale, and test/production package.json locations); relocate that explanation into the PR description or repository docs and leave this file free of implementation comments so only the actual module code (the version export/require logic) remains in packages/apps-engine/src/definition/version.ts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/apps-engine/src/definition/version.ts`:
- Around line 12-13: The runtime path detection uses a POSIX string suffix on
__dirname (const runningFromSource) which fails on Windows; change the check to
a cross-platform comparison using Node's path utilities
(path.normalize/path.join or splitting by path.sep) to compare the last path
segments (e.g., 'src' and 'definition') and then set requirePath accordingly;
update the symbols runningFromSource, requirePath and reference __dirname when
implementing the normalized/joined comparison so the correct package.json is
resolved on all platforms.
---
Nitpick comments:
In `@packages/apps-engine/src/definition/version.ts`:
- Around line 1-11: Remove the large explanatory block comment at the top of the
module (the multi-line comment describing Apps-Engine package version, require()
rationale, and test/production package.json locations); relocate that
explanation into the PR description or repository docs and leave this file free
of implementation comments so only the actual module code (the version
export/require logic) remains in packages/apps-engine/src/definition/version.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6208bf3e-b8dd-4134-9d37-97d643bb5b4e
📒 Files selected for processing (3)
packages/apps-engine/src/definition/version.tspackages/apps-engine/src/server/compiler/AppPackageParser.tspackages/apps-engine/tsconfig.json
✅ Files skipped from review due to trivial changes (1)
- packages/apps-engine/tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/apps-engine/src/server/compiler/AppPackageParser.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: 📦 Build Packages
- GitHub Check: CodeQL-Build
- GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
packages/apps-engine/src/definition/version.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.
📚 Learning: 2026-03-18T16:47:56.781Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39701
File: packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts:137-151
Timestamp: 2026-03-18T16:47:56.781Z
Learning: In `packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts`, the `EEXIST` catch block in the `DenoRuntimeSubprocessController` constructor (around lines 144–151) intentionally skips validating the target of a pre-existing `deno-runtime` symlink in the temp directory. The rationale is that spoofing the symlink requires the attacker to already have system-level write access to the temp directory, which grants far greater control than the deno-runtime sandbox could provide. Do not flag this as a security issue in future reviews.
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2026-03-06T18:09:17.867Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/elements/Timestamp/DateTimeFormats.spec.tsx:20-23
Timestamp: 2026-03-06T18:09:17.867Z
Learning: In the RocketChat/Rocket.Chat gazzodown package (`packages/gazzodown`), tests are intended to run under the UTC timezone, but as of PR `#39397` this is NOT yet explicitly enforced in `jest.config.ts` or the `package.json` test scripts (which just run `jest` without `TZ=UTC`). To make timezone-sensitive snapshot tests reliable across all environments, `TZ=UTC` should be added to the test scripts in `package.json` or to `jest.config.ts` via `testEnvironmentOptions.timezone`. Without explicit UTC enforcement, snapshot tests involving date-fns formatted output or `toLocaleString()` will fail for contributors in non-UTC timezones.
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2026-03-18T16:45:52.113Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 39701
File: packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts:181-188
Timestamp: 2026-03-18T16:45:52.113Z
Learning: In `packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts`, granting `--allow-read` to the full `this.tempFilePath` (entire temp directory) in the Deno subprocess spawn options is intentional. The `deno.jsonc` config file can affect path resolution in ways that require read access to the broader temp directory, not just the `deno-runtime` subdirectory symlink. Do not flag this as an overly broad permission grant.
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.
Applied to files:
packages/apps-engine/src/definition/version.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.
Applied to files:
packages/apps-engine/src/definition/version.ts
Proposed changes (including videos or screenshots)
Adds
src/definition/version.tswhich reads the package version viaresolveJsonModuleand exports it asENGINE_VERSION.Replaces
AppPackageParser.getEngineVersion()— which resolved the version by traversing the filesystem relative to__dirname— with a direct import ofENGINE_VERSION. This removes the assumption thatpackage.jsonlives at a predictable relative path, which will break whenAppPackageParsermoves to a different package during theapps-engine split.
Issue(s)
Steps to test or reproduce
Further comments
Related to the "Apps-Engine split" stack:
Summary by CodeRabbit